<?php
require('includes/application_top.php');
require(DIR_WS_LANGUAGES . $language . '/compbuild.php');
 $currency_symb_query = tep_db_query("select symbol_left, symbol_right from currencies where code='".$currency."'");
 $currency_symb = tep_db_fetch_array($currency_symb_query);
 
 $i=0;
 $configuration_query = tep_db_query("select configuration_id, configuration_title, configuration_value, use_function from " . TABLE_CONFIGURATION . " where configuration_group_id = 1 order by sort_order");
  while ($configuration = tep_db_fetch_array($configuration_query)) {
    if (tep_not_null($configuration['use_function'])) {
      $use_function = $configuration['use_function'];
      if (ereg('->', $use_function)) {
        $class_method = explode('->', $use_function);
        if (!is_object(${$class_method[0]})) {
          include(DIR_WS_CLASSES . $class_method[0] . '.php');
          ${$class_method[0]} = new $class_method[0]();
        }
        //$cfgValue = tep_call_function($class_method[1], $configuration['configuration_value'], ${$class_method[0]});
      } else {
        //$cfgValue = tep_call_function($use_function, $configuration['configuration_value']);
      }
    } else {
      $cfgValue[$i] = $configuration['configuration_value'];$i++ ;
    }



    if ( (isset($cInfo) && is_object($cInfo)) && ($configuration['configuration_id'] == $cInfo->configuration_id) ) {
      echo '                  <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_CONFIGURATION, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $cInfo->configuration_id . '&action=edit') . '\'">' . "\n";
    } else {
      echo '                  <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_CONFIGURATION, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $configuration['configuration_id']) . '\'">' . "\n";
    }
    

  }
?>

<html>
<head>
<meta http-equiv="Content-Language" content="he">
<meta http-equiv="Content-Type" content="text/html; charset=windows0255">
<title><?php echo $cfgValue[0]; ?></title>
</head>

<body>
    <center>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="650" id="AutoNumber1">
  <hr color="#000000" size="1">
  <tr>
   <td width="34%">
      <p align="center"><b><font face="Times New Roman" size="4"><u><?php echo $cfgValue[0]; ?></u><br>
        <?php echo TEXT_COMPUTER; ?></font></b>
         </td>
         <tr>
    <td width="37%">
      <p align="center"><b><font face="Verdana" size="2">

       <?php echo TEXT_ADDRESS; ?> : <?php echo $cfgValue[12]; ?><br>
       <?php echo TEXT_EMAIL; ?> : <?php echo $cfgValue[2]; ?></font></b>
    </td>
    </tr>
  </tr>
  <tr>
    <td colspan="3">
      <hr color="#000000" size="1">
      <br>
      <table border="1" align="center" cellpadding="0" cellspacing="5" style="border-collapse: collapse" bordercolor="#111111" width="645" id="AutoNumber2">
        <tr>
          <td width="16"><strong></strong></td>
          <td width="137"><strong><?php echo TEXT_PART_TYPE; ?></strong></td>
          <td width="373"><p align="center"><strong><?php echo TEXT_PART_NAME; ?></strong></td>
          <td width="100"><p align="center"><span lang="en-us"> <strong><?php echo TEXT_PRICE; ?></strong></span></td>
          <td width="52"><p align="center"><strong><?php echo TEXT_QUANTITY; ?></strong></td>
        </tr>
<?php
$InsertProducts=($HTTP_POST_VARS["product"]);
$InsertPrices=($HTTP_POST_VARS["price"]);
$InsertQTY=$HTTP_POST_VARS["ammount"];
    // echo $InsertQTY;
     //echo $InsertProducts;
     $InsertProducts=explode("::",$InsertProducts);
     $InsertPrices=explode("::",$InsertPrices);
     $InsertQTY=explode("::",$InsertQTY);

     $pcount=1;
     $bcomp_query = tep_db_query("select * from `compbuild_categories` ORDER BY pc_category_id");
      while ($bcomp = tep_db_fetch_array($bcomp_query)){
$pcid[$pcount]= $bcomp['pc_category_id'];
$pccat[$pcount]= $bcomp['pc_category_name'];
$pcimg[$pcount]= $bcomp['pc_category_image'];
$osccat[$pcount]= $bcomp['osc_category_id'];
$pcdep[$pcount]= $bcomp['pc_depends_on'];
$msys_id[$pcount]= $bcomp['pc_system_id'];
$presets[$pcount]= $bcomp['pc_preset_ids'];
$pclang[$pcount]= $bcomp['pc_language'];
?>
<tr>
   <td width="16"></td>
   <td width="137">
<?php echo $pccat[$pcount] ?> :</td>
          <td width="373"><?php  if (($InsertProducts[$pcount])!="0"){echo $InsertProducts[$pcount];} ?></td>
          <td width="100" align="center"><?php if (($InsertPrices[$pcount])!="0"){echo $currency_symb['symbol_left']." ".$InsertPrices[$pcount]." ".$currency_symb['symbol_right'];} ?></td>
          <td width="52" align="center"><?php if (($InsertProducts[$pcount])!="0"){echo $InsertQTY[$pcount];} ?></td>
        </tr>
<?php $pcount++; } ?>


      </table>
      <br>
    </td>
  </tr>
  <?php //---------------------------------------------------------------------------------------------
  ?>
  <tr>
    <td colspan="3">
      <table border="1" align="center" cellpadding="0" cellspacing="5" style="border-collapse: collapse" bordercolor="#111111" width="66%" id="AutoNumber3">
        <tr>
          <td width="123%" colspan="2"><b><font size="4"><?php echo TEXT_TOTAL_PRICE; ?><span lang="en-us">
            :</span> </font><font size="4" face="David"><?php echo $HTTP_POST_VARS["totsum"]; ?></font></b></td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td colspan="3"> <br>



      <hr color="#000000" size="1">
      <form method="POST">
        <p align="center" dir="ltr">
          <input type="button" value="PRINT" name="B1" onClick="window.print()">
        </p>
        <br>
      <center><font class=small color=#FF6600 size=1> Powered By <?php echo TEXT_TITLE; ?><br>This addon is copyrighted software.</center>
      </form>
    </td>
  </tr>
</table>

</body>
       </center>
</html>